package com.wzm.feign;

import com.wzm.domain.Move;
import com.wzm.domain.User;
import com.wzm.domain.UserMove;
import com.wzm.util.Ajaxresult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "move-server",fallbackFactory = MoveFallbackFactory.class)
@RequestMapping("/move")
public interface MoveClient {
    @GetMapping
    public List<Move> findAll();

    @GetMapping("/{id}")
    public Move findById(@PathVariable("id") Long id);

    @PostMapping("/buy")
    public Ajaxresult buyById(@RequestBody UserMove userMove);
    @PutMapping
    public Ajaxresult sendTicket(User user);
    @GetMapping("/watch/{id}")
    Ajaxresult watch(@PathVariable("id") Long id);
}
